package com.slm.report.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.slm.report.db.StudentInfoBean;
import com.slm.report.view.data.TimeContentView;

import java.util.List;

/**
 * @ProjectName: My Application
 * @Package: com.slm.report.adapter
 * @ClassName: DataContentAdapter
 * @Description: java类作用描述
 * @Author: 王丹丹
 * @CreateDate: 2020/6/1 10:38
 * @UpdateUser: 更新者
 * @UpdateDate: 2020/6/1 10:38
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class DataContentAdapter extends BaseAdapter {
    private Context mContext;
    private List<StudentInfoBean> infoBeanList;

    public DataContentAdapter(Context mContext, List<StudentInfoBean> infoBeanList) {
        this.mContext = mContext;
        this.infoBeanList = infoBeanList;
    }

    @Override
    public int getCount() {
        return infoBeanList == null ? 0 : infoBeanList.size();
    }

    @Override
    public Object getItem(int position) {
        return infoBeanList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = new TimeContentView(mContext);
        }
        return convertView;
    }
}

